package vn.edu.saigontech.ncms.model.comparator;

import java.util.Comparator;

import vn.edu.saigontech.ncms.model.bookstore.ItemTitle;
import vn.edu.saigontech.ncms.model.program.Level;

public class ItemTitleComparator implements Comparator<ItemTitle>{

	@Override
	public int compare(ItemTitle title1, ItemTitle title2) {
		Level level1 = title1.getLevels().iterator().next();
		Level level2 = title2.getLevels().iterator().next();
		return level1.getOrder() - level2.getOrder();
	}
}